FROM harbor.product.co-mall/library/centos-tomcat8:latest

# 实际容器化部署环境使用"remote" profile, 实现通过config-server获取配置
#ENV ACTIVE_PROFILE="online"

# Java MEM Options, 可以在部署时设置修改
ENV JAVA_MEM_OPTIONS="-Xmx2g -Xms2g"

# Java Start Default Options, 暂不开放部署时修改
#ENV JAVA_DFLT_OPTS="-server -XX:+PrintCommandLineFlags -Duser.timezone=GMT+08 -Djava.security.egd=file:/dev/./urandom -XX:MetaspaceSize=512m -XX:MaxMetaspaceSize=512m -Xss512k -XX:-UseParallelGC -XX:NewRatio=1 -XX:SurvivorRatio=8"

# Add jar file
ADD target/*.jar /app.jar

# cp time zone
#RUN \cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

# Expose service port
EXPOSE 8080

ENTRYPOINT ["sh","-c","exec java $JAVA_MEM_OPTIONS -jar /app.jar"]
